<?php
include "Class/EasyMySQL.php";

    $mysql = new EasyMySQL();
    if(!$mysql->Connect())  return;

    $method = $_REQUEST["Method"];
    $data = file_get_contents('php://input', 'r');
    $data = iconv("GB2312", "UTF-8//IGNORE", $data);

    if($method == "Select")
    {
        $mysql->SELECT("DeviceType")->QuerySelect();
    }
    else if($method == "Insert")
    {
        $mysql->Insert("DeviceType")->InsertColumns("UID,Name")->InsertValues($data, 2)->Query();
    }
    else if($method == "Update")
    {
        $array = explode("#", $data);
        $mysql->Update("DeviceType")->UpdateSet($array[0])->WhereUpdate("UID=".$array[1])->Query();
    }
    else if($method == "Delete")
    {
        $mysql->Delete("DeviceType")->WhereDelete("UID", $data)->Query();
    }

    $mysql->Close();
?>